package com.cx.controller;

import com.cx.entity.Account;
import com.cx.entity.User;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;

/**
 * @ClassName: ParmsController
 * @Description:
 * @Author: cx
 * @Date: 2022/10/20 3:17
 **/
@Controller
public class ParmsController {
    //springmvc自动封装
    // 自动封装user对象，前面传来的
    @RequestMapping("/value")
    public String test04(@RequestBody User user) {
        System.out.println("请求体得参数为" + user);
        return "success";
    }

    //当一个对象中得属性是另一个对象时，这个对象能否接收参数成功
    @RequestMapping("/value05")
    public String test05(@RequestBody Account account) {
        System.out.println("请求体得参数为" + account);
        return "success";
    }
}
